package pearson.automation.forms;

import org.openqa.selenium.By;

import framework.BaseForm;
import framework.elements.Button;
import framework.elements.ComboBox;

public class CourseSelectDialog extends BaseForm {
    private static ComboBox courses = new ComboBox(By.name("course"), "Courses"); 
    private Button cancel = new Button(By.name("_cancel"), "Cancel");
    private Button select = new Button(By.xpath("//input[@value='Select']"), "Submit");
    
    public CourseSelectDialog() {
        super(courses.getLocator(), "Add library item");
    }
    
    public void selectCourse(String moduleName) {
        courses.selectByText(moduleName);
    }
    
    public MyLibraryForm clickCancel() {
        cancel.clickAndWait();
        return new MyLibraryForm();
    }

    public AddLibraryForm clickSelect() {
        select.clickAndWait();
        return new AddLibraryForm();
    }
    
    public void clickSelectWithoutAddLibrary() {
        select.clickAndWait();
    }
    
}
